<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<html:html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title></title>
	<META http-equiv=Pragma content=no-cache>
	<META http-equiv=Cache-Control content=no-cache>
	<META http-equiv=Expires content=0>
	<link rel="stylesheet"
		href="<%=request.getContextPath()%>/resource/css/style.css"
		type="text/css">
	<script language="javascript" type="text/javascript"
		src="<%=request.getContextPath()%>/resource/js/util.js"></script>
	<script language="javascript" type="text/javascript"
		src="<%=request.getContextPath()%>/style/scripts/util.js"></script>
	<script language="javascript" type="text/javascript"
		src="<%=request.getContextPath()%>/resource/js/AdyhUtil.js"></script>
	<script language="javascript" type="text/javascript"
		src="<%=request.getContextPath()%>/resource/js/Validator.js"></script>
	<script language="javascript" type="text/javascript"
		src="<%=request.getContextPath()%>/resource/calendar/DCDA_C03.js"></script>
	<script>
/**保存*/
function ShowAlert()
{ResetMe();	
	var name = document.getElementById("name").value;
	var productCode = document.getElementById("productCode").value;	
	var objPrompt = document.getElementById("divPrompt");
    objPrompt.style.display = "block";
    objPrompt.innerHTML = "";
	if(name.length==0||productCode.length==0){		
		if(name.length==0){
			objPrompt.innerHTML += "<li><bean:message key="F02.ModelType"/> <bean:message key="adyh.error.isnull"/>";
			document.getElementById("name").className = "MyControlError";
		}
		if(productCode.length==0){			
			objPrompt.innerHTML += "<li><bean:message key="adyh.productType"/> <bean:message key="adyh.error.isnull"/>";
			document.getElementById("productCode").className = "MyControlError";
		}		
	}else{
		var operationType = document.getElementById("operationType").value;
		operation(operationType);
	}
}
/**重置*/
function ResetMe()
{    
	document.getElementById("name").className = "MyText";
	document.getElementById("productCode").className = "MySelect";	
	
	var objPrompt = document.getElementById("divPrompt");
    objPrompt.style.display = "none";
	objPrompt.innerHTML = "";
}
function ShowFormTitle(strTitle)
{
	document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"height:26px; background-position: left bottom; background-image: url(../../resource/image/FormTitle_A_4.gif); background-repeat: repeat-x;\">");
	document.write("  <tr >");
	document.write("	<td style=\"width:5px; background-position: left bottom; background-image: url(../../resource/image/FormTitle_A_1.gif); background-repeat: no-repeat;\">&nbsp;&nbsp;&nbsp;</td>");
	document.write("	<td class=\"FormTitle\" style=\"width:100%; padding-left:5px; padding-top:3px; background-position: left bottom; background-image: url(../../resource/image/FormTitle_A_2.gif); background-repeat: no-repeat;\">");
	document.write("		<span id=\"spanFormTitle\" class=\"SpanTitle\">"+ strTitle +"</span>");
	document.write("	</td>");
	document.write("	<td style=\"width:5px; background-position: right bottom; background-image: url(../../resource/image/FormTitle_A_3.gif); background-repeat: no-repeat;\">&nbsp;&nbsp;&nbsp;</td>");
    document.write("  </tr>");
	document.write("</table>");
}
</script>
</head>

<body>
	<html:form method="post" action="/pages/F02/F020101.do">
		<html:hidden property="operationType" />
		<html:hidden property="errorFlag" />
		<!--Begin：表单标题-->
		<div class="DivBlock">
			<script language="javascript" type="text/javascript">
		ShowFormTitle("<bean:message key="F020101.title"/>");
	</script>
		</div>
		<!--End：表单标题-->

		<!--Begin：表单主体区块-->
		<div class="DivBlock">
			<div class="DivWrap" style="display:block">
				<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
					<TR>						
						<TD ALIGN="right" NOWRAP WIDTH="15%">
							<!--模型名称--><bean:message key="F02.ModelType"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP WIDTH="18%">
							<html:text property="name" styleClass="MyText" />
							<span class="Need">*</span>
						</TD>
						<TD ALIGN="right" NOWRAP WIDTH="15%">
							<!--产品类别--><bean:message key="adyh.productType"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP WIDTH="18%"> 
							<html:select property="productCode" styleClass="MySelect">															
								<html:optionsCollection property="productType" value="CODE" label="NAME" />
							</html:select>
							<span class="Need">*</span>
						</TD>
						<TD ALIGN="right" NOWRAP WIDTH="15%">							
						</TD>
						<TD ALIGN="left" NOWRAP WIDTH="19%"> 							
						</TD>
					</TR>										
					<TR>
						<TD ALIGN="right" NOWRAP>
						<!--描述--><bean:message key="adyh.description"/>&nbsp;
						</TD>
						<TD ALIGN="left" NOWRAP colspan="3">
							<html:textarea property="description" styleClass="MyArea" rows="3"
								style="width:96%"></html:textarea>							
						</TD>
					</TR>
				</TABLE>
			</div>
		</div>
		<!--End：表单主体区块-->

		<!--Begin：表单按钮及提示区-->
		<div class="DivBlock">
			<div class="DivButton">
				<input type="button" name="Submit1" class="MyButton"
					onClick="ShowAlert()" value="<bean:message key="common.save"/>">
				<input type="button" name="Submit2" class="MyButton" value="<bean:message key="common.back"/>"
					onClick="javascript:operation('back');">
			</div>
			<div class="DivPrompt" id="divPrompt" style="display:none">
			</div>
		</div>
		<!--End：表单按钮及提示区-->
	</html:form>
</body>
</html:html>
<script language="javascript" type="text/javascript">
InitForm();
</script>